package com.xbk.platform;

import java.util.List;

import com.xbk.platform.sql.ConnectionMananger;
import com.xbk.util.StringUtil;

public class BusinessObjectMananger {
	
	public static BusinessObjectGroup loadBoList(String keys,String sTableName,String sSql) throws Exception{
		DaoUtil du = ConnectionMananger.getDaoUtil();
		BusinessObjectGroup bog = new BusinessObjectGroup(keys, sTableName, du);
		List<DataMap> dataRS = du.getResults(StringUtil.getRealSQL(sSql,sTableName,null));
		for (DataMap data : dataRS) {
			BusinessObject bo = new BusinessObject(keys, sTableName, du);
			bo.setBoData(data);
			bog.addItem(bo);
		}
		return bog;
	}
}
